<?php

namespace app\models\db;

use Yii;

/**
 * This is the model class for table "t_ad".
 *
 * @property string $id
 * @property string $e_shop_id
 * @property string $name
 * @property string $image_id
 * @property string $link_url
 * @property string $description
 * @property integer $is_shown
 * @property string $ad_category_id
 * @property integer $sort
 * @property string $mini_program_id
 * @property integer $is_enabled
 * @property integer $is_deleted
 * @property string $create_datetime
 * @property string $modify_datetime
 */
class Ad extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 't_ad';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'e_shop_id'], 'required'],
            [['is_shown', 'sort', 'is_enabled', 'is_deleted'], 'integer'],
            [['create_datetime', 'modify_datetime'], 'safe'],
            [['id', 'e_shop_id', 'image_id', 'ad_category_id', 'mini_program_id'], 'string', 'max' => 36],
            [['name', 'link_url', 'description'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'e_shop_id' => 'E Shop ID',
            'name' => 'Name',
            'image_id' => 'Image ID',
            'link_url' => 'Link Url',
            'description' => 'Description',
            'is_shown' => 'Is Shown',
            'ad_category_id' => 'Ad Category ID',
            'sort' => 'Sort',
            'mini_program_id' => 'Mini Program ID',
            'is_enabled' => 'Is Enabled',
            'is_deleted' => 'Is Deleted',
            'create_datetime' => 'Create Datetime',
            'modify_datetime' => 'Modify Datetime',
        ];
    }
}
